FMTS=magproto.o gpx.o geo.o mapsend.o mapsource.o \
gpsutil.o pcx.o cetus.o copilot.o gpspilot.o magnav.o \
psp.o holux.o garmin.o tmpro.o tpg.o \
- xcsv.o gcdb.o tiger.o internal_styles.o
+ xcsv.o gcdb.o tiger.o internal_styles.o easygps.o
FILTERS=position.o duplicate.o
(echo -n "internal_styles.c: mkstyle.sh " ; echo style/*.style ; /bin/echo -e "\t./mkstyle.sh > internal_styles.c" ) >> /tmp/dep
echo Edit Makefile and bring in /tmp/dep
-VERSIONU=1_1_1_beta00508003
-VERSIOND=1.1.1_beta00508003
+VERSIONU=1_1_1_beta00514003
+VERSIOND=1.1.1_beta00514003
release:
rm -fr gpsbabel-$(VERSIOND)
cvs tag gpsbabel_$(VERSIONU)
http://xcski.com/~ptomblin/CoPilot/
http://navaid.com/CoPilot/
+ EasyGPS
+
+ This is the binary file format used by EasyGPS. This format is
+ seemingly being phased out in favor of GPX in newer versions of
+ EasyGPS, but this allows conversions to and from the old binary
+ .loc format.
+
+ http://www.easygps.com/
+
+ Information about and sketchy code to implement this file format
+ were provided by Eric Cloninger.
+
DATA FILTERS
${PNAME} -i copilot -f reference/UKultralight.pdb -o gpx -F ${TMPDIR}/cop1.gpx
${PNAME} -i copilot -f ${TMPDIR}/cop.pdb -o gpx -F ${TMPDIR}/cop2.gpx
compare ${TMPDIR}/cop1.gpx ${TMPDIR}/cop2.gpx
+
+#
+# EasyGPS. Another binary format.
+#
+rm -f ${TMPDIR}/easy.loc
+${PNAME} -i easygps -f reference/easygps.loc -o easygps -F ${TMPDIR}/ez.loc
+${PNAME} -i easygps -f reference/easygps.loc -o gpx -F ${TMPDIR}/ez1.gpx
+${PNAME} -i easygps -f ${TMPDIR}/ez.loc -o gpx -F ${TMPDIR}/ez2.gpx
+compare ${TMPDIR}/ez1.gpx ${TMPDIR}/ez2.gpx
#include <stdlib.h>
#include <ctype.h>
+static int i_am_little_endian = -1;
+static int doswap(void);
+
#ifdef DEBUG_MEM
#define DEBUG_FILENAME "/tmp/gpsbabel.debug"
return src;
}
+/*
+ * Duplicate a pascal string into a normal C string.
+ */
+char *
+pstrdup(char *src)
+{
+ int len = src[0];
+ char *obuf = xmalloc(len + 1);
+ memcpy(obuf, src + 1, len);
+ obuf[len] = 0;
+
+ return obuf;
+}
void
rtrim(char *s)
return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);
}
+/*
+ * Read a little-endian 64-bit value from 'src' and return it in 'dest'
+ * in host endianness.
+ */
+void
+le_read64(void *dest, void *src)
+{
+ char *cdest = dest;
+ char *csrc = src;
+
+ doswap(); /* make sure i_am_little_endian is initialized */
+
+ if (i_am_little_endian) {
+ memcpy(dest, src, 8);
+ } else {
+ int i;
+ for (i = 0; i < 7; i++) {
+ cdest[i] = csrc[7-i];
+ }
+ }
+}
+
void
le_write16(void *addr, unsigned value)
{
return NULL;
}
-static int swapit = -1;
-
static int doswap()
{
- if (swapit < 0)
+ if (i_am_little_endian < 0)
{
/* On Intel, Vax and MIPs little endian, -1.0 maps to the bytes
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f and on Motorola,
double d = 1.0;
char c[8];
memcpy(c, &d, 8);
- swapit = (c[0] == 0);
+ i_am_little_endian = (c[0] == 0);
}
- return swapit;
+ return i_am_little_endian;
}
double
double ret;
char r[8];
int i;
- doswap(); /* make sure swapit is initialized */
+ doswap(); /* make sure i_am_little_endian is initialized */
for (i = 0; i < 8; i++)
{
- int j = (swapit)?(7-i):i;
+ int j = (i_am_little_endian)?(7-i):i;
r[i] = ((char*)ptr)[j];
}
memcpy(&ret, r, 8);
int i;
memcpy(r, &d, 8);
- doswap(); /* make sure swapit is initialized */
+ doswap(); /* make sure i_am_little_endian is initialized */
for (i = 0; i < 8; i++)
{
- int j = (swapit)?(7-i):i;
+ int j = (i_am_little_endian)?(7-i):i;
*(char*)ptr++ = r[j];
}
return;
extern ff_vecs_t magnav_vec;
extern ff_vecs_t tmpro_vecs;
extern ff_vecs_t gcdb_vecs;
+extern ff_vecs_t easygps_vecs;
static
vecs_t vec_list[] = {
"U.S. Census Bureau Tiger Mapping Service",
NULL
},
+ {
+ &easygps_vecs,
+ "easygps",
+ "EasyGPS",
+ NULL
+ },
{
NULL,
NULL,